﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    Codebehind="OutInvoiceGenerate.aspx.cs" Inherits="Ankin.EHBH.Web.Modules.StockManage.OutInvoiceGenerate"
    Title="医用耗材管理系统" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cphcenter" runat="server">

    <script src="../../js/jquery-1.3.2.min.js" type="text/javascript"></script>

    <script src="../../js/jquery.flexselect.js" type="text/javascript"></script>

    <script src="../../js/liquidmetal.js" charset="gb2312" type="text/javascript"></script>

    <script src="../../js/popup.js" type="text/javascript"></script>

    <script type="text/javascript">
      $(document).ready(function() {
        $("select[class*=flexselect]").flexselect();
        $("input:text:enabled:first").focus();
        
        //获取供应商文本
        $('#ctl00_cphcenter_ddlDept_flexselect').blur(function() 
        {var tt = $('#ctl00_cphcenter_ddlDept_flexselect').attr('value');
        $('#ctl00_cphcenter_hdfSupply').attr('value',tt);
        })
        

        

        /*测试COOKIES*/
        if($.cookie('popupStatus')==1)
        {
            disablePopup();
            centerPopup();
            loadPopup();
        }
        //写Cookies
        $('#wCookies').click(function(){
		$.cookie('name', 'test11213',{expires: 7});				  
		});
		//读Cookies
		$('#rCookies').click(function(){
		var test = $.cookie('popupStatus');
		alert (test);
		});
		
		$('#rCookies1').click(function(){
		var test = $.cookie('popupStatus');
		alert (test);
		});
		//删除
		$('#dCookies').click(function(){
		$.cookie('popupStatus', '0',{expires: 7});							  
		});
		
      });


function Button1_onclick() {
var index=$("#ctl00_cphcenter_ddlExpName2").getSelectedIndex();
$("#ctl00_cphcenter_ddlExpName2").setSelectedValue("01010002");
var rr=$("#ctl00_cphcenter_ddlExpName2").getSelectedText();
$("#ctl00_cphcenter_ddlExpName2").change();
alert(index);


}

 function printPage(id){
 var isprint=confirm("生成成功，是否打印此出库单");
  if(isprint){
     window.open ('OutInvoicePrint.aspx?id='+id, 'newwindow', 'top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=yes,location=no, status=no');
  }
  else
  window.location.href='../apply/NetApplySearch.aspx';
 
 }

    </script>

    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td class="right-color">
                出库管理-出库单生成</td>
        </tr>
    </table>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-top: 14px;">
        <tr>
            <td class="bor bor-bg">
                出库单信息</td>
        </tr>
        <tr>
            <td class="bor">
                <table width="100%" border="0" cellpadding="0" cellspacing="0" class="t1">
                    <tr>
                        <td>
                            出库单号</td>
                        <td>                            
                            <asp:Label ID="txtBill_Id" runat="server" Width="80px"></asp:Label></td>
                        <td>
                            出库日期</td>
                        <td>
                            <asp:Label ID="lblIn_Date" runat="server" Text="时间"></asp:Label></td>
                        <td>
                            操作员</td>
                        <td>
                            <asp:TextBox ID="txtOperator" runat="server" ReadOnly="True"></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td>
                            出库类型</td>
                        <td>
                            <asp:DropDownList ID="ddlIn_Class" runat="server">
                            </asp:DropDownList>
                        </td>
                        <td>
                            领取部门</td>
                        <td colspan="3">
                            <asp:DropDownList ID="ddlDept" CssClass="flexselect" runat="server">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            请领经手人</td>
                        <td>
                            <asp:TextBox ID="txtDepter" runat="server" ReadOnly="True"></asp:TextBox></td>
                        <td>
                            出库经手人</td>
                        <td>
                            <asp:TextBox ID="txtHandler" runat="server"></asp:TextBox></td>
                        <td>
                            出库方式</td>
                        <td>
                            <asp:DropDownList ID="ddlIndicator" runat="server">
                                <asp:ListItem Value="0">实际出库</asp:ListItem>
                                <asp:ListItem Value="1">暂存</asp:ListItem>
                            </asp:DropDownList>&nbsp;</td>
                    </tr>
                    <tr>
                        <td>
                            确认人</td>
                        <td>
                            <asp:TextBox ID="txtVerifyer" runat="server"></asp:TextBox></td>
                        <td>
                        </td>
                        <td>
                        </td>
                        <td>
                            实际金额</td>
                        <td>
                            ￥<asp:Label ID="lblRealPric" runat="server" Text="0"></asp:Label></td>
                    </tr>
                    <tr>
                        <td>
                            备注</td>
                        <td colspan="5">
                            <asp:TextBox ID="txtMemo" runat="server" TextMode="MultiLine" Width="98%"></asp:TextBox>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-top: 14px;">
        <tr>
            <td class="bor bor-bg">
                请领明细</td>
        </tr>
        <tr>
            <td class="bor" style="padding: 13px;">
                <asp:GridView ID="grdApplyDetail" Width="100%" runat="server" AutoGenerateColumns="False"
                    DataKeyNames="info_id" OnRowCommand="grdApplyDetail_RowCommand">
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <RowStyle CssClass="gv-first-line" />
                    <PagerStyle CssClass="fy" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle CssClass="gv-head" />
                    <EditRowStyle BackColor="#2461BF" />
                    <AlternatingRowStyle BackColor="White" />
                    <EmptyDataTemplate>
                        <table width="450" height="100">
                            <tr>
                                <td class="jg">
                                    对不起，没有找到任何相关记录
                                </td>
                            </tr>
                        </table>
                    </EmptyDataTemplate>
                    <Columns>
                    <asp:BoundField DataField="info_id" HeaderText="信息号" >
                        <ControlStyle CssClass="hidden" />
                        <ItemStyle CssClass="hidden" />
                        <HeaderStyle CssClass="hidden" />
                        <FooterStyle CssClass="hidden" />
                    </asp:BoundField>
                        <asp:BoundField DataField="book_id" HeaderText="产品编号" />
                        <asp:BoundField DataField="class_name" HeaderText="产品分类" />
                        <asp:BoundField DataField="exp_name" HeaderText="产品名称" />
                        <asp:BoundField DataField="specs" HeaderText="规格型号" />
                        <asp:BoundField DataField="quantity" HeaderText="请领数量" />
                        <asp:BoundField DataField="APPROVE_QTY" HeaderText="审核数量" />
                        <asp:ButtonField ButtonType="Button" CommandName="add" Text="明细" >
                            <ControlStyle CssClass="button" />
                        </asp:ButtonField>
                    </Columns>
                </asp:GridView>
                <table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-top: 10px;
                    padding-bottom: 10px;">
                    <tr>
                        <td>
                            <asp:Panel ID="p2" runat="server">
                                <div id="button">
                                    <input type="button" value="添加明细" id="addmx" class="longbutton" style="width: 90px;
                                        height: 25px; cursor: pointer;" /></div>
                            </asp:Panel>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-top: 13px;">
        <tr>
            <td class="bor bor-bg">
                出库单明细</td>
        </tr>
        <tr>
            <td style="padding: 13px;" class="bor">
                <asp:GridView ID="grvDetailList" Width="100%" runat="server" OnRowDataBound="grvDetailList_RowDataBound"
                    CellPadding="4" ForeColor="#333333" AutoGenerateColumns="False" OnRowDeleting="grvDetailList_RowDeleting"
                    DataKeyNames="EXP_CODE,IN_BILL">
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <RowStyle CssClass="gv-first-line" />
                    <PagerStyle CssClass="fy" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <HeaderStyle CssClass="gv-head" />
                    <EditRowStyle BackColor="#2461BF" />
                    <AlternatingRowStyle BackColor="White" />
                    <EmptyDataTemplate>
                        <table width="450" height="100">
                            <tr>
                                <td class="jg">
                                    对不起，没有找到任何相关记录
                                </td>
                            </tr>
                        </table>
                    </EmptyDataTemplate>
                    <Columns>
                        <asp:TemplateField HeaderText="序号" InsertVisible="False" SortExpression="LessonID">
                         <ItemTemplate>
                             <asp:Label ID="Label2" runat="server"  
                              Text='<%# this.grvDetailList.PageIndex * this.grvDetailList.PageSize + this.grvDetailList.Rows.Count + 1%>'  >
                              </asp:Label>
                        </ItemTemplate>
                        </asp:TemplateField> 
                        <asp:BoundField DataField="IN_BILL" HeaderText="入库单号" />
                        <asp:BoundField DataField="IN_ID" HeaderText="入库流水帐号" />
                        <asp:BoundField HeaderText="产品分类" />
                        <asp:BoundField HeaderText="产品名称" DataField="EXP_CODE" />
                        <asp:BoundField HeaderText="产品代码" DataField="EXP_CODE" />
                        <asp:BoundField HeaderText="规格型号" DataField="SPECS" />
                        <asp:BoundField HeaderText="出库数量" DataField="BOOK_QUAN" />
                        <asp:BoundField HeaderText="单位" DataField="UNITS" />
                        <asp:BoundField HeaderText="批发价" DataField="TRADE_PRIC" />
                        <asp:BoundField HeaderText="零售价" DataField="RETAIL_PRIC" />
                        <asp:CommandField DeleteText="&lt;div id=&quot;de&quot; onclick=&quot;JavaScript:return confirm('确定删除吗？')&quot;&gt;删除&lt;/div&gt; "
                            ShowDeleteButton="True" HeaderText="删除" ControlStyle-CssClass="button" />
                    </Columns>
                </asp:GridView>
                <table width="100%" border="0" cellpadding="0" cellspacing="0" style="margin-top: 13px;
                    padding-bottom: 13px;">
                    <tr>
                        <td align="center">
                            <asp:Button ID="btnSaveInInvoice" runat="server" Text="保存出库单" OnClick="btnSaveInInvoice_Click"
                                CssClass="longbutton" Width="90" Height="25" Style="cursor: pointer;" />
                            <asp:Button ID="btnCancel" runat="server" Text="返回列表" CssClass="longbutton" Width="90"
                                Height="25" Style="cursor: pointer;" OnClick="btnCancel_Click" />
                            <asp:Label ID="lblVaildsave" runat="server" ForeColor="Red"></asp:Label>&nbsp;
                            <asp:HiddenField ID="hdfSupply" runat="server" Value="noSelect" />
                            <asp:HiddenField ID="hdfExp_Name" runat="server" Value="noSelect" />
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <div id="popupContact" style=" width: 800px;">
        <a id="popupContactClose">x</a>
        <br />
        <table width="800px" border="0" cellpadding="0" cellspacing="0" id="TABLE1">
            <tr>
                <td class="bor bor-bg">
                    出库产品</td>
            </tr>
            <tr>
                <td class="bor" style="padding: 13px;">
                    <asp:Panel ID="p1" runat="server" Width="100%" BorderWidth="0px">
                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="t1">
                            <tr>
                                <td style="width: 69px;">
                                    产品名称</td>
                                <td style="width: 169px">
                                    <asp:DropDownList ID="ddlExp_Name" CssClass="flexselect" AutoPostBack="true" runat="server">
                                    </asp:DropDownList></td>
                                <td style="width: 70px">
                                    规格型号</td>
                                <td style="width: 58px">
                                    <asp:DropDownList ID="ddlSpecs" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlSpecs_SelectedIndexChanged">
                                    </asp:DropDownList>
                                    <div style="display: none;">
                                        <asp:TextBox ID="TxtExpName" runat="server" OnTextChanged="TxtExpName_TextChanged"
                                            AutoPostBack="True"></asp:TextBox></div>
                                </td>
                                <td>
                                    &nbsp;
                                </td>
                                <td style="width: 75px">
                                    &nbsp;
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                    <asp:Panel ID="p3" runat="server" Width="100%" BorderWidth="0px">
                        <table width="100%" border="0" cellpadding="0" cellspacing="0" class="t1">
                            <tr>
                                <td style="width: 69px;">
                                    产品名称</td>
                                <td style="width: 169px">
                                    <asp:TextBox ID="txtExpName3" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox>
                                </td>
                                <td style="width: 70px">
                                    规格型号</td>
                                <td style="width: 58px">
                                    <asp:TextBox ID="txtSpec3" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td style="width: 75px">
                                        &nbsp;
                                    </td>
                            </tr>
                        </table>
                    </asp:Panel>
                    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="t1">
                        <tr>
                            <td style="width: 63px" align="right">
                                一级分类</td>
                            <td style="width: 88px">
                                <asp:TextBox ID="txtPrim_Name" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox>&nbsp;</td>
                            <td style="width: 65px" align="right">
                                二级分类</td>
                            <td style="width: 58px">
                                <asp:TextBox ID="txtSec_Name" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox>&nbsp;</td>
                            <td style="width: 75px" align="right">
                            </td>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 63px" align="right">
                                *请领数量</td>
                            <td style="width: 88px">
                                <asp:TextBox ID="txtNoVeriApply_Quan" runat="server" BackColor="LightGray" OnKeyPress="if(((event.keyCode>=48)&&(event.keyCode <=57) )) {event.returnValue=true;} else{event.returnValue=false;}"
                                    ReadOnly="True">0</asp:TextBox>
                            </td>
                            <td style="width: 65px" align="right">
                                审核数量</td>
                            <td style="width: 58px">
                                <asp:TextBox ID="txtApply_Quan" runat="server" BackColor="LightGray" onkeypress="if(((event.keyCode>=48)&&(event.keyCode <=57) )) {event.returnValue=true;} else{event.returnValue=false;}"
                                    ReadOnly="True">0</asp:TextBox></td>
                            <td style="width: 75px" align="right">
                                批发价</td>
                            <td style="width: 5px">
                                <asp:TextBox ID="txtMarket_Pric" BackColor="LightGray" runat="server" ReadOnly="True">0</asp:TextBox></td>
                        </tr>
                        <tr>
                            <td style="width: 63px; height: 24px;" align="right">
                                *出库数量</td>
                            <td style="width: 88px; height: 24px;">
                                <asp:TextBox ID="txtBook_Quan" runat="server" OnKeyPress="if(((event.keyCode>=48)&&(event.keyCode <=57) )) {event.returnValue=true;} else{event.returnValue=false;}"
                                    AutoPostBack="True" OnTextChanged="txtBook_Quan_TextChanged">0</asp:TextBox>&nbsp;</td>
                            <td style="width: 65px; height: 24px;" align="right">
                                单位</td>
                            <td style="width: 58px; height: 24px;">
                                <asp:TextBox ID="txtUnits2" BackColor="LightGray" runat="server">0</asp:TextBox></td>
                            <td style="width: 75px; height: 24px;" align="right">
                                零售价格</td>
                            <td style="height: 24px">
                                <asp:TextBox ID="txtPurchase_Pric" runat="server">0</asp:TextBox></td>
                        </tr>
                        <tr>
                            <td style="width: 63px" align="right">
                                库存选择</td>
                            <td colspan="5">
                                <asp:GridView ID="grdInputBookList" Width="100%" runat="server" AutoGenerateColumns="False"
                                    OnRowDataBound="grdInputBookList_RowDataBound" OnPageIndexChanging="grdInputBookList_PageIndexChanging">
                                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                                    <RowStyle CssClass="gv-first-line" />
                                    <PagerStyle CssClass="fy" />
                                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                                    <HeaderStyle CssClass="gv-head" />
                                    <EditRowStyle BackColor="#2461BF" />
                                    <AlternatingRowStyle BackColor="White" />
                                    <EmptyDataTemplate>
                                        <table width="450" height="100">
                                            <tr>
                                                <td class="jg">
                                                    对不起，没有找到任何相关记录
                                                </td>
                                            </tr>
                                        </table>
                                    </EmptyDataTemplate>
                                    <Columns>
                                        <asp:BoundField HeaderText="入库时间" DataField="IN_DATE" />
                                        <asp:BoundField HeaderText="入库单号" DataField="BILL_ID" />
                                        <asp:BoundField HeaderText="流水号" DataField="BOOK_ID" />
                                        <asp:BoundField HeaderText="现存数量" DataField="CUR_QUAN" />
                                        <asp:TemplateField HeaderText="出库数量">
                                            <ItemTemplate>
                                                <asp:TextBox ID="txtOut_Quan" AutoPostBack="true" OnTextChanged="txtOut_Quan_TextChanged"
                                                    Width="50px" OnKeyPress="if(((event.keyCode>=48)&&(event.keyCode <=57) )) {event.returnValue=true;} else{event.returnValue=false;}"
                                                    runat="server"></asp:TextBox>
                                            </ItemTemplate>
                                        </asp:TemplateField>
                                        <asp:BoundField HeaderText="入库数量" DataField="BOOK_QUAN" />
                                        <asp:BoundField HeaderText="生产批号" DataField="BATCH_ID" />
                                        <asp:BoundField HeaderText="有效期" DataField="EFFECT" />
                                    </Columns>
                                </asp:GridView>
                            </td>
                        </tr>
                        <tr>
                            <td style="width: 63px; height: 27px" align="right">
                                基本信息号</td>
                            <td style="width: 88px; height: 27px">
                                <asp:TextBox ID="txtInfo_Id" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox></td>
                            <td style="width: 65px; height: 27px" align="right">
                                消耗品代码</td>
                            <td style="width: 58px; height: 27px">
                                <asp:TextBox ID="txtExp_Code" runat="server" BackColor="LightGray"></asp:TextBox></td>
                            <td align="right" style="width: 75px; height: 27px">
                                分类代码</td>
                            <td style="height: 27px">
                                <asp:TextBox ID="txtExp_Name_Class" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox></td>
                        </tr>
                        <tr>
                            <td style="width: 63px" align="right">
                                产品名称</td>
                            <td style="width: 88px">
                                <asp:TextBox ID="txtExp_Name2" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox></td>
                            <td style="width: 65px" align="right">
                                规格型号</td>
                            <td style="width: 58px">
                                <asp:TextBox ID="txtSpecs" runat="server" BackColor="LightGray"></asp:TextBox>
                            </td>
                            <td align="right" style="width: 75px">
                                规格缩写</td>
                            <td>
                                <asp:TextBox ID="txtSpecs_Abbr" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox>&nbsp;</td>
                        </tr>
                            <tr>
                                <td align="right" style="height: 28px">
                                    生产厂家</td>
                                <td style="height: 28px">
                                    <asp:TextBox ID="txtFactory" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox>
                                    <asp:HiddenField ID="hfdFactory" runat="server" />
                                    </td>
                                <td align="right" style="height: 28px">
                                    产地</td>
                                <td style="height: 28px">
                                    <asp:TextBox ID="txtFcountry" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox>
                                    <asp:HiddenField ID="hfdFcountry" runat="server" />
                                    </td>
                                <td align="right" style="height: 28px">
                                    国别</td>
                                <td style="height: 28px">
                                    <asp:TextBox ID="txtExp_Country" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox>
                                    <asp:HiddenField ID="hfdExp_Country" runat="server" />
                                </td>
                            </tr>
                        <tr>
                            <td style="width: 63px" align="right">
                                库存单位</td>
                            <td style="width: 88px">
                                <asp:TextBox ID="txtUnits" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox>&nbsp;</td>
                            <td style="width: 65px" align="right">
                                参考批发价</td>
                            <td style="width: 58px">
                                <asp:TextBox ID="txtTrade_Pric" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox></td>
                            <td align="right" style="width: 75px">
                                参考零售价</td>
                            <td>
                                <asp:TextBox ID="txtRetail_Pric" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox>&nbsp;</td>
                        </tr>
                        <tr>
                            <td style="width: 63px" align="right">
                                现有库存</td>
                            <td style="width: 88px">
                                <asp:TextBox ID="txtNowSock" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox></td>
                            <td style="width: 65px" align="right">
                                库存上限</td>
                            <td style="width: 58px">
                                <asp:TextBox ID="txtUp_Lim" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox></td>
                            <td align="right" style="width: 75px">
                                库存下限</td>
                            <td>
                                <asp:TextBox ID="txtLow_Lim" runat="server" ReadOnly="true" BackColor="LightGray"></asp:TextBox></td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
        <asp:Button ID="btnSaveToDt" runat="server" Text="添加" OnClick="btnSaveToDt_Click"
            CssClass="longbutton" Width="90" Height="25" Style="cursor: pointer;" />
        <input name="" id="btnClosePop" type="button" value="关闭按钮" class="longbutton" style="cursor: pointer;
            width: 90px; height: 25px;" />
        <asp:Label ID="lblVaild" runat="server" ForeColor="Red"></asp:Label>
    </div>
    <div id="backgroundPopup">
    </div>
</asp:Content>
